﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace Himp.Platform.Dc
{
    /// <summary>
    /// 公用项目
    /// </summary>
    [Table("PUB_ITEM")]
    public class PubItem : FullAuditedAggregateRoot<Guid>, IMultiTenant
    {
        public PubItem(Guid pubItemTypeId, Guid defChrgitmTypeId
            , string pubItemCodg, string pubItemName
            , string spec, string unt)
        {
            PubItemTypeId = pubItemTypeId;
            DefChrgitmTypeId = defChrgitmTypeId;
            PubItemCodg = pubItemCodg;
            PubItemName = pubItemName;
            Spec = spec;
            Unt = unt;
        }

        /// <summary>
        /// 公用项目类别Id
        /// </summary>
        public Guid PubItemTypeId { get; set; }

        /// <summary>
        /// 公用项目类别
        /// </summary>
        public PubItemType PubItemType { get; set; }

        /// <summary>
        /// 默认收费项目类别
        /// </summary>
        public Guid DefChrgitmTypeId { get; set; }

        /// <summary>
        /// 默认收费项目类别
        /// </summary>
        public ChrgitmType DefChrgitmType { get; set; }

        /// <summary>
        /// 公用项目编码
        /// </summary>
        [Column("PUB_ITEM_CODG")]
        public string PubItemCodg { get; set; }

        /// <summary>
        /// 公用项目名称
        /// </summary>
        [Column("PUB_ITEM_NAME")]
        public string PubItemName { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        [Column("SPEC")]
        public string Spec { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [Column("UNT")]
        public string Unt { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        [Column("PRIC")]
        public decimal Pric { get; set; }

        /// <summary>
        /// 拼音助记码
        /// </summary>
        [Column("PINYINCODE")]
        public string? Pinyincode { get; set; }

        /// <summary>
        /// 五笔助记码
        /// </summary>
        [Column("WUBICODE")]
        public string? Wubicode { get; set; }

        /// <summary>
        /// 物价码
        /// </summary>
        [Column("PRICE_CODE")]
        public string? PriceCode { get; set; }

        /// <summary>
        /// 审核标识
        /// </summary>
        [Column("CHK_FLAG")]
        public bool ChkFlag { get; set; }

        /// <summary>
        /// 停用
        /// </summary>
        [Column("DISAB_FLAG")]
        public bool DisabFlag { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        [Column("SRT_NO")]
        public int SrtNo { get; set; }

        /// <summary>
        /// 协定项目标识
        /// </summary>
        [Column("AGMT_ITEM_FLAG")]
        public bool AgmtItemFlag { get; set; }

        /// <summary>
        /// 对应具体明细项Id
        /// </summary>
        [Column("DETL_ITEM_ID")]
        public Guid? DetlItemId { get; set; }

        /// <summary>
        /// 明细项
        /// 协定项目
        /// </summary>
        public List<AgmtItem> AgmtItems { get; set; }

        /// <summary>
        /// 公用项目对应执行科室
        /// </summary>
        public List<PubItemAssocExeDept> PubItemAssocExeDepts { get; set; }

        /// <summary>
        /// 公用项目对应开单科室
        /// </summary>
        public List<PubItemAssocBilgDept> PubItemAssocBilgDepts { get; set; }

        /// <summary>
        /// 公共项目对应收费项目类别
        /// </summary>
        public List<PubItemAssocChrgitmType> PubItemAssocChrgitmTypes { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? TenantId { get; set; }

        ///// <summary>
        ///// 处方标记
        ///// 允许门诊
        ///// </summary>
        //public bool RxFlag { get; set; }

        ///// <summary>
        ///// 医嘱标记
        ///// 允许住院
        ///// </summary>
        //public bool DrordFlag { get; set; }

        ///// <summary>
        ///// 护士执行
        ///// </summary>
        //public bool IsNurseExec { get; set; }

        ///// <summary>
        ///// 检验标志
        ///// </summary>
        //public bool IsInspected { get; set; }

        ///// <summary>
        ///// 医保审批
        ///// </summary>
        //public bool IsMedicalInsuranceApproval { get; set; }

        ///// <summary>
        ///// 可预约
        ///// </summary>
        //public bool EnableReservation { get; set; }

        ///// <summary>
        ///// 副标题
        ///// </summary>
        //public string SubTitle { get; set; }

        ///// <summary>
        ///// 描述
        ///// </summary>
        //public string Description { get; set; }

        ///// <summary>
        ///// 内容
        ///// </summary>
        //public string ImageContents { get; set; }

        ///// <summary>
        ///// 咨询电话
        ///// </summary>
        //public string ConsultingTelephone { get; set; }

        ///// <summary>
        ///// 图标
        ///// </summary>
        //public string Icon { get; set; }

        ///// <summary>
        ///// 简介图片
        ///// </summary>
        //public string ProfilePhoto { get; set; }

        /// <summary>
        /// 设置审核
        /// </summary>
        /// <param name="status"></param>
        public void SetApproval(bool status)
        {
            ChkFlag = status;
        }

        /// <summary>
        /// 设置停用
        /// </summary>
        /// <param name="status"></param>
        public void SetDeactivate(bool status)
        {
            DisabFlag = status;
        }
    }
}
